IF NOT EXISTS (SELECT * FROM sys.change_tracking_databases WHERE database_id = DB_ID(N'G2C')) 
   ALTER DATABASE [G2C] 
   SET  CHANGE_TRACKING = ON
GO


IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Membership]')) 
   ALTER TABLE [dbo].[aspnet_Membership] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Paths]')) 
   ALTER TABLE [dbo].[aspnet_Paths] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_PersonalizationAllUsers]')) 
   ALTER TABLE [dbo].[aspnet_PersonalizationAllUsers] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_PersonalizationPerUser]')) 
   ALTER TABLE [dbo].[aspnet_PersonalizationPerUser] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Profile]')) 
   ALTER TABLE [dbo].[aspnet_Profile] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Roles]')) 
   ALTER TABLE [dbo].[aspnet_Roles] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_SchemaVersions]')) 
   ALTER TABLE [dbo].[aspnet_SchemaVersions] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Users]')) 
   ALTER TABLE [dbo].[aspnet_Users] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_UsersInRoles]')) 
   ALTER TABLE [dbo].[aspnet_UsersInRoles] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_WebEvent_Events]')) 
   ALTER TABLE [dbo].[aspnet_WebEvent_Events] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[ProjectDocument]')) 
   ALTER TABLE [dbo].[ProjectDocument] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[ProjectPhoto]')) 
   ALTER TABLE [dbo].[ProjectPhoto] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[Idea]')) 
   ALTER TABLE [dbo].[Idea] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[IdeaRating]')) 
   ALTER TABLE [dbo].[IdeaRating] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[InvestmentCategory]')) 
   ALTER TABLE [dbo].[InvestmentCategory] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[Project]')) 
   ALTER TABLE [dbo].[Project] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[ProjectIdea]')) 
   ALTER TABLE [dbo].[ProjectIdea] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[ProjectRating]')) 
   ALTER TABLE [dbo].[ProjectRating] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[UserInterest]')) 
   ALTER TABLE [dbo].[UserInterest] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[UserProfile]')) 
   ALTER TABLE [dbo].[UserProfile] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[aspnet_Applications]')) 
   ALTER TABLE [dbo].[aspnet_Applications] 
   ENABLE  CHANGE_TRACKING
GO

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[Volunteer]')) 
   ALTER TABLE [dbo].[Volunteer] 
   ENABLE  CHANGE_TRACKING
GO